/*********************************************************
          File Name:9.4.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Mon 14 Sep 2015 04:21:34 PM CST
**********************************************************/

#include <iostream>
#include <vector>

using std::vector;
using std::cout;
using std::endl;

bool find(vector<int>::iterator begin, vector<int>::iterator end, int target)
{
        auto iter = begin;
        while(iter != end)
        {
                if(*iter == target)
                        return true;
                ++iter;
        }
        return false;
}

int main()
{
        vector<int> v{1,2, 3, 4, 5, 6, 7, 8};
        bool res = find(v.begin(), v.end(), 3);
        
        cout << ((res == true) ? "find" : "not found") << endl;

        return 0;
}
